﻿using Manon.Core.Jwt.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;

namespace Manon.Core.Jwt
{
    /// <summary>
    /// 刷新token用
    /// </summary>
    public interface IJwtAppService
    {
        /// <summary>
        /// 新增 Jwt token
        /// </summary>
        /// <param name="dto">用户信息数据传输对象</param>
        /// <returns></returns>
        JwtAuthorizationOutput GenerateAccessToken(JwtAuthorizationInput input);

        /// <summary>
        /// 刷新 Token
        /// </summary>
        /// <param name="token">Token</param>
        /// <param name="dto">用户信息</param>
        /// <returns></returns>
        JwtAuthorizationOutput Refresh(string token, JwtAuthorizationInput input);


        string GenerateRefreshToken();

        ClaimsPrincipal GetPrincipalFromExpiredToken(string token, string issuer, string audience, string signingKey);
    }
}
